#pragma once
#include "ImageWnd.h"
#include "WavTipCtrl.h" 

// CEmployeeTableDlg dialog
class CbackManageDlg;
enum nDateStamp {
	GRADUATION_DAY,
	JOIN_DAY,		
	BIRTH_DAY,
	MAX_DAY
};

typedef struct _Employee_
{
	CString		Index;
	CString 		Name;
	bool 		Sex;		//combo
	CString 		Image;
	CString 		Attr;
	CString 		Password;
	s32 			Type;		//combo
	s32			Grade;		//combo
	CString 		Master;
	s32 			Education;
	CString 		School;
	s32			CardType;	//combo
	CString 		CardNO;
	CString 		Phone1;
	CString 		Phone2;
	CString 		Email;
	CString 		Salary;
	CString 		Annaual ;
	CString 		Commission;
	CString 		Remark;

	s32			Year[MAX_DAY];
	s32			Month[MAX_DAY];
	s32			Day[MAX_DAY];
}Employee;
class CEmployeeTableDlg : public CMaxDisplayDlg
{
	DECLARE_DYNAMIC(CEmployeeTableDlg)

public:
	CEmployeeTableDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~CEmployeeTableDlg();
	virtual BOOL PreTranslateMessage(MSG* pMsg);

// Dialog Data
	enum { IDD = IDD_DIALOG_EMPLOYEE };
protected:
	Employee m_nEmployee;
	CComboBox			m_nCBSex;
	CComboBox			m_nCBType;
	CComboBox			m_nCBGrade;
	CComboBox			m_nCBCardType;
	CComboBox			m_nCBEducation;
	
	CComboBox			m_nCBYear[MAX_DAY];
	CComboBox			m_nCBMonth[MAX_DAY];
	CComboBox			m_nCBDay[MAX_DAY];
	CString				m_nLastAbbr;
	CString				m_nLastCardNO;
	CString				m_nLastPhone1;
	CString				m_nLastPhone2;
	CString				m_nLastSalary;
	CString				m_nLastAnnaual;
	CString				m_nLastCommission;
	CString 				m_nImagePath;
	CString 				m_nLastEmail;
	
	HANDLE        			m_hEvent;
	CImageWnd			m_wndImage;
	CWavTipCtrl 			m_tooltip;
	void GetControllerInfo(Employee *pEmployee);
	void SetControllerInfo(Employee *pEmployee);
	void ClearControllerInfo(void);	
	bool  IsLeapYear(int Year) ;  
protected:
	virtual BOOL OnInitDialog();	
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	afx_msg LRESULT OnNetMessage(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedBtnEmpImage();
public:
	afx_msg void OnEnChangeEditEpyIndex();
public:
	afx_msg void OnEnChangeEditEpyAttr();
	afx_msg void OnEnChangeEditEpyCardNO();
	afx_msg void OnEnChangeEditEpyPhone1();
	afx_msg void OnEnChangeEditEpyPhone2();
	afx_msg void OnEnChangeEditEpyEmail();
	afx_msg void OnEnChangeEditEpySalary();
	afx_msg void OnEnChangeEditEpyAnnaual();
	afx_msg void OnEnChangeEditEpyCommission();	
public:
	afx_msg void OnCbnDropdownCbEpyBday();
public:
	afx_msg void OnBnClickedBtnEmpAdd();
	afx_msg void OnBnClickedBtnEmpEdit();
	afx_msg void OnBnClickedBtnEmpDel();
	afx_msg void OnBnClickedBtnEmpSrc();
	afx_msg void OnBnClickedBtnEmpStatstics();

};
